#/bin/sh
SOURCE="$0"                                                                                                                                                                                                        
DIR="$( cd -P "$( dirname "$SOURCE"  )" && pwd  )"
cd $DIR
NOW=`date`
IP=`curl -4 https://ifconfig.me 2>/dev/null`
IP=`echo ${IP} |grep -v "^ *$" | xargs`
echo Current IP: $IP
if [ -n "$IP" ]; then
  echo ${IP} >IPAddress.txt
  git add *
  git commit -m "$NOW"
  git push
fi
